package com.lagou.niancheng.lagou.service.mail.service;

import com.lagou.niancheng.lagou.service.common.EmailApi;
import com.lagou.niancheng.lagou.service.common.EmailDTO;
import com.lagou.niancheng.lagou.service.common.Result;
import com.lagou.niancheng.lagou.service.common.ResultBuilder;
import org.apache.dubbo.config.annotation.Service;

import javax.annotation.Resource;

/**
 * com.lagou.niancheng.lagou.service.mail.service.MailApiImpl
 *
 * @author 大犬
 * @date 2020/7/18
 */
@Service
public class MailApiImpl implements EmailApi {

    @Resource
    private MailService mailService;

    @Override
    public Result sendMail(EmailDTO emailDTO) {
        mailService.sendMail(emailDTO.getEmail(), emailDTO.getCode());
        return ResultBuilder.toSuccess(null);
    }
}
